package com.ctshk.rpc.train.req;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * <p>
 *    机场快线 - 剩余票数缓存操作请求对象
 * <p/>
 * @author 北落
 * @create 2021-04-23
 */
@Data
@ApiModel(value="CacheSetReq", description="巴士产品剩余票数操作")
public class CacheSetReq implements Serializable {

    @NotEmpty(message = "产品id不能为空")
    @ApiModelProperty(value = "产品id")
    private String key;

    @NotNull(message = "操作数量不能为空")
    @ApiModelProperty(value = "操作数量")
    private Long val;

    @NotNull(message = "操作类型不能为空")
    @Range(min = 1,max = 4,message = "操作类型不正确")
    @ApiModelProperty(value = "操作类型：1:add 2:min 3:set 4:del")
    private Integer type;
}
